<template>
  <div class="dialog-mask" v-show="show">
    <iframe :src="pcURL" v-if="show" frameborder="0"></iframe>     
    <a href="javascript:;" class="btn-close" @click="close">&times;</a>
  </div>
</template>

<script>
  export default {
    props: {
      show : {
        type: Boolean,
        require: true,
        twoway: true
      },
      id: {
        type: [String, Number],
        require: true
      }
    },
    computed:{
      pcURL: function(){
        return Global.api.h5pc + this.id;
      }
    },
    methods: {
      close: function(){
        this.show = false;
      }
    }
  }
</script>
<style scoped>
  .dialog-mask {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;    
    z-index: 9999;
    transition: opacity .3s ease;
    background-color: rgba(0, 0, 0, 0.5);
  }
  .btn-close,
  .btn-close:hover {
    position: absolute;
    display: block;
    right: 20px;
    top: 20px;
    width:40px;
    height: 40px;
    text-align: center;
    line-height: 40px;
    color: #fff;
    font-size: 40px;
    z-index: 9999;
  }
  iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
  }
</style>